<template lang="html">
    <div class="feedback">
        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item><i class="el-icon-message"></i>&nbsp;意见反馈列表</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="container">
            <div style="height:20px;"></div>
            <el-table :data="list" style="width: 100%" v-loading="loading">
                <el-table-column prop="id" label="ID" width="100"></el-table-column>
                <el-table-column prop="user_id" label="用户ID"  align="center"></el-table-column>
                <el-table-column prop="content" label="反馈内容"  align="center"></el-table-column>
                <el-table-column prop="create_time" label="反馈时间"  align="center"></el-table-column>
                <!-- <el-table-column label="操作" align="center">
                    <template slot-scope="scope" >
                        <el-button class="check" size="small" type="text"  @click="ToDetail(scope.row)" >查看</el-button>
                    </template>
                </el-table-column> -->
            </el-table>
            <div class="pagination" v-show="total>1">
                <el-pagination
                @current-change="handleCurrentChange"
                :page-size="pageSize"
                layout="total, prev, pager, next"
                :total="total">
                </el-pagination>
            </div>
        </div>
    </div>
</template>

<script>
import {getFeedList} from '@/api/goods/list'
    export default {
        name: "feedback",
        data() {
            return {
                loading:true,//加载中
                pageIndex:1,
                pageSize:10,
                total:0,//总条数
                list:[],//意见反馈列表
            }
        },
        created(){
            //获取列表
            this.getFeedList();
        },
        mounted() {
            
        },
        methods: {
            //获取列表
            getFeedList(){
                getFeedList(this.pageIndex,this.pageSize).then(res => {
                    // console.log(res);
                    this.list = [];
                    this.loading = false;//加载中
                    this.list = res.data.list;
                    this.total = res.data.total;
                })
            },
            handleCurrentChange(index){
                this.loading = true;//加载中
                this.pageIndex = index;
                this.getFeedList();//重新加载
            },
        }
    }
</script>

<style lang="css" scoped>
.check {
    color: orange;
}
</style>
